<?php

header('Access-Control-Allow-Origin: *');

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$app->get('/', function () use ($app) {
    return $app->version();
});

// 汽车相关接口
$app->group(['prefix' => 'car'], function () use ($app) {
    // 获取三级车系联动数据接口
    $app->get('carLevel', 'CarController@carLevel');
    // 获取对应车系下的所有车型数据接口
    $app->get('carModel', 'CarController@carModel');
});


// 地区相关接口
$app->group(['prefix' => 'area'], function () use ($app) {
    // 写入地区接口
    $app->get('writeArea', 'AreaController@writeArea');
    // 获取对应车系下的所有车型数据接口
    $app->get('getArea', 'AreaController@getArea');
});

// 图片相关接口
$app->group(['prefix' => 'img'], function () use ($app) {
    // 上传图片接口
    $app->post('uploadImg', 'ImgController@uploadImg');
});

// 中诚信相关接口
$app->group(['prefix' => 'credit'], function () use ($app) {
    // 个人综合信用评分T2接口
    $app->post('score_t1', 'CreditController@scoreT1');
    // 个人综合信用评分（五维度评分）
    $app->post('score_general', 'CreditController@scoreGeneral');
    // 金融画像信息T2
    $app->post('portrait_finance', 'CreditController@portraitFinance');
});
